package com.kedou.sdk.params;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

/**
 * Created by Administrator on 2017/6/7 0007.
 */

public class CheckVersionRequestParams extends BaseRequestParams implements Parcelable {

    private static final String SERVICE = "check_version";

    /**
     * 设备系统
     */
    @SerializedName("device")
    private String device = "android";

    /**
     * 当前版本
     */
    @SerializedName("version_name")
    private String versionName;

    public CheckVersionRequestParams() {
        this("1", 1);
    }

    public CheckVersionRequestParams(String gameId, int channelId) {
        setGameId(gameId);
        setChannelId(String.valueOf(channelId));
    }

    @Override
    public String getServiceString() {
        return SERVICE;
    }

    public String getDevice() {
        return device;
    }

    public String getVersionName() {
        return versionName;
    }

    public void setVersionName(String versionName) {
        this.versionName = versionName;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        super.writeToParcel(dest, flags);
        dest.writeString(this.device);
        dest.writeString(this.versionName);
    }

    protected CheckVersionRequestParams(Parcel in) {
        super(in);
        this.device = in.readString();
        this.versionName = in.readString();
    }

    public static final Creator<CheckVersionRequestParams> CREATOR = new Creator<CheckVersionRequestParams>() {
        @Override
        public CheckVersionRequestParams createFromParcel(Parcel source) {
            return new CheckVersionRequestParams(source);
        }

        @Override
        public CheckVersionRequestParams[] newArray(int size) {
            return new CheckVersionRequestParams[size];
        }
    };
}
